package practise.hibernate.dao;

import org.springframework.transaction.annotation.Transactional;
import practise.hibernate.persistence.Address;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xinlyu
 * Date: 7/18/12
 * Time: 1:07 PM
 * To change this template use File | Settings | File Templates.
 */
public interface AddressDao {
    static int a=0;
    @Transactional(readOnly = true)
    List<Address> findAllAddresses();

    @Transactional(readOnly = true)
    List<Address> findByLocation(String location);
    @Transactional(readOnly = false)
    void deleteAddress(int id);

    @Transactional
    Address merge(Address address);
}
